home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
os2bbs
/
ftpfid16.zip
/
HANGUP.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-02-16
|
2KB
|
88 lines
/* Hangup.cmd */
parse arg ftproc
hangflg = 'f:\bbs\logs\hangup.flg'
flg = 'f:\bbs\logs\Doing_ftp.flg' /* process flag */
hisbsy = 'f:\binkley\outbound\018c0001.bsy'
binkflg = 'f:\bbs\binkley\flags\task.03'
maxflg = 'f:\bbs\max\system\active03.bbs'
ftpin = 'd:\ftpin\*.*'
tcpbin = 'd:\tcpip\bin'
a = 0
b = 0
abort = 0
thistime = 0
lastime = 0
elapsed = time('e')
do forever
Select
When Stream(flg,'C', 'Query Exists') <>' ' Then
Do
rc = SysFileTree(ftpin,files.,"F")
if a > 2 then
do
'go -k 'ftproc /* process killer. ftproc is the PID */
abort = 1
signal Ttyl
end
if files.0 > 0 then
do
if b > 9 | b = 0 then
do
thistime = files.0
if thistime = lastime then
do
'go -k 'ftproc /* process killer. ftproc is the PID */
abort = 1
signal Ttyl
end
else b = 0
lastime = thistime
end
end
else a = a + 1
say 'Must be doing mail....waiting 5 mins.'
Call SysSleep 300
b = b + 1
end
When Stream(maxflg,'C', 'Query Exists') <>' ' Then
Do
elapsed = time('e')
if elapsed > 3600 then signal Ttyl
say 'Someones on the BBS....waiting 5 mins.'
Call SysSleep 300
b = b + 1
end
When Stream(binkflg,'C', 'Query Exists') <>' ' Then
Do
elapsed = time('e')
if elapsed > 3600 then signal Ttyl
say 'Someones on the mailer....waiting 5 mins.'
Call SysSleep 300
b = b + 1
end
Otherwise
do
signal ttyl
end
end /* Select */
end /* Do Forever */
Ttyl:
rc=doscreat(hangflg) /* Set process flag */
IF rc <> 1 Then say 'Error creating hangup flagfile.!'
if abort = 1 then
do
del flg' > nul: 2>&1'
del hisbsy' > nul: 2>&1'
end
New=Directory(tcpbin)
'pppkill > nul: 2>&1'
exit